package route

import (
	"github.com/gin-gonic/gin"
	"hepan1/src/controller"
	"hepan1/src/middleware"
)

func PathRoute(r *gin.Engine)*gin.Engine{
	//root := r.Group("/User")
	r.Use(middleware.Ragnarok())

	r.POST("/WXlogin1", controller.WXlogin1)
	shouldLogin := r.Group("/User")
	shouldLogin.Use(middleware.HaveLogin())
	{
		shouldLogin.GET("/GetTheFra", controller.GetTheFra)
		shouldLogin.GET("/GetMyFra", controller.GetMyFra)
		shouldLogin.GET("/ChouTimes",controller.ChouTimes)
		shouldLogin.GET("/gift", controller.Gift)
		shouldLogin.POST("/GiftInform", controller.GiftInform)
		shouldLogin.POST("/GiftRe", controller.GiftRe)
		shouldLogin.POST("/GetTheTimes", controller.GetTheTimes)
		shouldLogin.POST("/ComeToDraw",controller.ComeToDraw)
		shouldLogin.GET("/EverDraw",controller.EverDraw)
	}
	r.GET("/GiftTime",controller.GiftTime)
	r.GET("/GiftQRcode", controller.GiftQRcode)
	return r
}